 var APP=is_app();
 var CustomerID =getcookie("CustomerID");
 var cert_td=false,certNo_td=false,rap_td=false,discount_td=false,USDperPrice_td=false,USDprice_td=false,place_td=false,RMBperPrice_td=false,RMBprice_td=false;
 var OriginSN_td=false;
 var SN_td=false;
 var UpdateTime_td=false;
 var download_td=false;
 var print_td=false;
 var exist_td=false;
 var discountsUSD_td=false;
 var discountsRMB_td=false;
 var tablePct_td=false;
 var depthPct_td=false;
 var CustomerRights=getcookie("CustomerRights");//客户权限
 var Discounts=getcookie("Discounts");//客户折扣

 //其它产品权限
 var RMBPrice_td_new=false,price_td_new=false,place_td_new=false;
 var discountParcelPrice_per_td_new=false,discountParcelRMBPrice_per_td_new=false,discountParcelPrice_td_new=false,discountParcelRMBPrice_td_new=false; //统包优惠价
 var RMBRingPrice_td_new=false,priceRing_td_new =false,placeRing_td_new=false;  //￥/Pcs S/Pcs 系列 总重 主石重量 形状 材质
 var discountRingPrice_td_new=false,discountRingRMBPrice_td_new=false; //成品优惠价
 var RMBInlaySettingsPrice_td_new=false,placeInlaySettings_td_new=false; //空托
 var discountInlaySettingsRMBPrice_td_new=false; //空托优惠价

 if(Discounts=="" || Discounts==null){
 	Discounts=1;
 }
 if(CustomerRights=="" || CustomerRights==null){//为了给APP做兼容
 	
 }else{
 	var powerli=CustomerRights.split("|");
 	for(var k=0;k<powerli.length;k++){
        var power=powerli[k].split(",");
        for(var i=0;i<power.length;i++){
            var data_power=power[i];
            if(data_power=="1"){//证书
                cert_td=true;
            }else if(data_power=="2"){//证书号
                certNo_td=true;
            }else if(data_power=="3"){//rap
                rap_td=true;
            }else if(data_power=="4"){//退点
                discount_td=true;
            }else if(data_power=="5"){//$/ct
                USDperPrice_td=true;
            }else if(data_power=="6"){//$/pcs
                USDprice_td=true;
            }else if(data_power=="7"){//所在地
                place_td=true;
            }else if(data_power=="8"){//￥/ct
                RMBperPrice_td=true;
            }else if(data_power=="9"){//￥/pcs
                RMBprice_td=true;
            }else if(data_power=="10"){//原货号
                OriginSN_td=true;
            }else if(data_power=="11"){ //货号
                SN_td=true;
            }else if(data_power=="12"){ //上架
                UpdateTime_td=true;
            }else if(data_power=="13"){ //下载
                download_td=true;
            }else if(data_power=="14"){//借货
                print_td=true;
            }else if(data_power=="15"){//现货/订货
                exist_td=true;
            }else if(data_power=="18"){ //优惠$
                discountsUSD_td=true;
            }else if(data_power=="19"){//优惠￥
                discountsRMB_td=true;
            }else if(data_power=="20"){ //台宽比
                tablePct_td=true;
            }else if(data_power=="21"){ //全深比
                depthPct_td=true;
            }else if(data_power=="201"){  //产品人民币
                RMBPrice_td_new=true;
            }else if(data_power=="202"){  //产品美元
                price_td_new=true;
            }else if(data_power=="208"){ //产品产地
                place_td_new=true;
            }else if(data_power=="209"){
                discountParcelPrice_per_td_new=true; //优惠$/Ct
            }else if(data_power=='210'){
                discountParcelRMBPrice_per_td_new=true; //优惠￥/Ct
            }else if(data_power=="211"){
                discountParcelPrice_td_new=true; //优惠$
            }else if(data_power=='212'){
                discountParcelRMBPrice_td_new=true; //优惠￥
            }else if(data_power=="301"){ //成品
                RMBRingPrice_td_new=true;
            }else if(data_power=="302"){
                priceRing_td_new=true
            }else if(data_power=="308"){
                placeRing_td_new=true;
            }else if(data_power=="309"){
                discountRingPrice_td_new=true;
            }else if(data_power=="310"){
                discountRingRMBPrice_td_new=true;
            }else if(data_power == "701"){   //空托
                RMBInlaySettingsPrice_td_new=true;
            }else if(data_power == "702"){
                placeInlaySettings_td_new=true;
            }else if(data_power == "703"){
                discountInlaySettingsRMBPrice_td_new=true;
            }

        }
	}

 }
 //CustomerID 缺失需重新登录
if (CustomerID == "" || CustomerID==undefined) {
	if(APP){
        var userAgent=navigator.userAgent;
        if(userAgent.indexOf('Android')!=-1){
		    YiYi_APP.reLogin();    	//调用app的重新登录方法
        }
	}else{
		 window.location.href = "/customer/index";
	}       
}  